﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace IWS.SiteManager.Web.Views
{
	public class LayoutView<T> : System.Web.Mvc.ViewPage<T>
		where T : class, new()
	{
		public LayoutView()
		{
		}

		protected override void OnPreInit(EventArgs e)
		{
			base.OnPreInit(e);

			if (this.ViewData.ContainsKey(Core.Constants.ViewDataMasterPageFile))
				this.MasterPageFile = this.ViewData[Core.Constants.ViewDataMasterPageFile].ToString();
			else
				this.MasterPageFile = "~/Views/Shared/Template.Master";

			if (this.ViewData.ContainsKey(Core.Constants.ViewDataTitle))
				this.Title = this.ViewData[Core.Constants.ViewDataTitle].ToString();
		}
	}
	public class LayoutView : System.Web.Mvc.ViewPage
	{
		public LayoutView()
		{
		}

		protected override void OnPreInit(EventArgs e)
		{
			base.OnPreInit(e);

			if (this.ViewData.ContainsKey(Core.Constants.ViewDataMasterPageFile))
				this.MasterPageFile = this.ViewData[Core.Constants.ViewDataMasterPageFile].ToString();
			else
				this.MasterPageFile = "~/Views/Shared/Template.Master";

			if (this.ViewData.ContainsKey(Core.Constants.ViewDataTitle))
				this.Title = this.ViewData[Core.Constants.ViewDataTitle].ToString();
		}
	}
}
